package com.onenine.app.model;

import java.util.ArrayList;
import java.util.List;

/**
 * 探索筛选条件
 */
public class NearbyCondition {

    public static final int DEFAULT_AGE_BEGIN = 0;
    public static final int DEFAULT_AGE_END = 50;
    public static final int DEFAULT_DISTANCE = 30;
    private int ageb = DEFAULT_AGE_BEGIN;
    private int agee = DEFAULT_AGE_END;
    private int distance = DEFAULT_DISTANCE * 1000;
    private int sex;
    private List<String> labels = new ArrayList<>();

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getAgeb() {
        return ageb;
    }

    public void setAgeb(int ageb) {
        this.ageb = ageb;
    }

    public int getAgee() {
        return agee;
    }

    public void setAgee(int agee) {
        this.agee = agee;
    }

    public int getDistance() {
        return distance;
    }

    public void setDistance(int distance) {
        this.distance = distance;
    }

    public List<String> getLabels() {
        return labels;
    }

    public boolean addLabel(String labelId) {
        if (!this.labels.contains(labelId)) {
            return this.labels.add(labelId);
        }
        return false;
    }

    public boolean removeLabel(String labelId) {
        return this.labels.remove(labelId);
    }

    public void reset() {
        ageb = DEFAULT_AGE_BEGIN;
        agee = DEFAULT_AGE_END;
        distance = DEFAULT_DISTANCE * 1000;
        sex = 0;
        this.labels.clear();
    }

}
